//
//  YSCardSwitch.h
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/14.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "YSCardItem.h"

@class YSCardSwitch;

@protocol YSCardSwitchDelegate <NSObject>

@optional
/**
 滚动代理方法
 */
- (void)cardSwitch:(YSCardSwitch *)cardSwitch didSelectedAtIndex:(NSInteger)index;

@end

@interface YSCardSwitch : UIView

/**
 代理
 */
@property (nonatomic, weak) id<YSCardSwitchDelegate>delegate;
/**
 当前选中位置
 */
@property (nonatomic, assign) NSInteger selectedIndex;
/**
 设置数据源
 */
@property (nonatomic, strong) NSArray <YSCardItem *>*items;
/**
 是否分页，默认为true
 */
@property (nonatomic, assign) BOOL pagingEnabled;

/**
 手动滚动到某个卡片位置
 */
- (void)switchToIndex:(NSInteger)index animated:(BOOL)animated;

@end
